<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Net&Talk</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="../Vue.js" type="text/javascript"></script>
</head>
<body>
      <div id="app">
          <button @click="getjoke">获取一个笑话</button>
          <div>{{joke}}</div>
      </div>
      <script>
          let app = new Vue({
              el:'#app',
              data:{
                  joke:'我们来搞笑一点'
              },
              methods:{
                  getjoke:function (){
                      var that = this
                      axios.get('https://autumnfish.cn/api/joke/').then(function (res){
                          that.joke = res.data
                      },function (err){
                          alert(err)
                      })
                  }
              }
          })
      </script>
</body>
</html>